<include file="public@header"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            {:lang('ADMIN_MAILER_INDEX')}<span class="layui-badge-rim page-content">开始配置网站邮箱及模板</span>
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title" id="tabHeader">
                            <li class="layui-this">{:lang('ADMIN_MAILER_INDEX')}</li>
                            <li><a href="{:url('mailer/template')}?template_key=verification_code">数字验证码邮件模板</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form method="post" class="layui-form js-ajax-form" action="{:url('Admin/mailer/indexPost')}" wid110>
                        <div class="layui-tab-content">
                            <div class="layui-form-item">
                                <label for="input-from_name" class="layui-form-label">
                                    <span class="form-required">*</span>
                                    {:lang('SENDER_NAME')}
                                    <a href="http://www.thinkcmf.com/faq.html?url=https://www.kancloud.cn/thinkcmf/faq/493502"
                                       title="查看帮助手册"
                                       data-toggle="tooltip"
                                       target="_blank"><i class="fa fa-question-circle"></i></a>
                                </label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" id="input-from_name" name="from_name"
                                           value="{$from_name|default=''}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="input-from" class="layui-form-label">
                                    <span class="form-required">*</span>{:lang('SENDER_EMAIL_ADDRESS')}
                                </label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" id="input-from" name="from" value="{$from|default=''}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="input-host" class="layui-form-label">
                                    <span class="form-required">*</span>{:lang('SENDER_SMTP_SERVER')}
                                </label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" id="input-host" name="host" value="{$host|default=''}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="js-smtpsecure" class="layui-form-label">
                                    <span class="form-required">*</span>连接方式
                                </label>
                                <div class="layui-input-inline">
                                    <select name="smtp_secure" id="js-smtpsecure">
                                        <option value="">默认</option>
                                        <option value="ssl">ssl</option>
                                        <option value="tls">tls</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="input-port" class="layui-form-label">
                                    <span class="form-required">*</span>SMTP服务器端口
                                </label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" id="input-port" name="port" value="{$port|default=''}"
                                           placeholder="默认为25">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="input-login_name" class="layui-form-label">
                                    <span class="form-required">*</span>{:lang('SMTP_MAIL_ADDRESS')}
                                </label>
                                <div class="layui-input-block">
                                    <input type="text" class="layui-input" id="input-login_name" name="username"
                                           value="{$username|default=''}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label for="input-password" class="layui-form-label">
                                    <span class="form-required">*</span>{:lang('SMTP_MAIL_PASSWORD')}
                                </label>
                                <div class="layui-input-block">
                                    <input type="password" class="layui-input" id="input-password" name="password"
                                           value="{$password|default=''}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button type="submit" class="layui-btn js-ajax-submit">{:lang('SAVE')}</button>
                                    <a class="layui-btn layui-btn-primary" href="javascript:admin.openIframeLayer('{:url('mailer/test')}','发送测试邮件',{area:['640px','50%'],end:function(){location.reload();}});">测试邮件</a>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<include file="public@script"/>
<script>
    $(function () {
        $('#js-smtpsecure').val("{$smtp_secure|default=''}");
    });
</script>
</body>
</html>